# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2Resource do
  @moduledoc """
  Information related to the Google Cloud resource.

  ## Attributes

  *   `awsMetadata` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2AwsMetadata.t`, *default:* `nil`) - The AWS metadata associated with the finding.
  *   `azureMetadata` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2AzureMetadata.t`, *default:* `nil`) - The Azure metadata associated with the finding.
  *   `cloudProvider` (*type:* `String.t`, *default:* `nil`) - Indicates which cloud provider the finding is from.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The human readable name of the resource.
  *   `gcpMetadata` (*type:* `GoogleApi.SecurityCenter.V1.Model.GcpMetadata.t`, *default:* `nil`) - The GCP metadata associated with the finding.
  *   `location` (*type:* `String.t`, *default:* `nil`) - The region or location of the service (if applicable).
  *   `name` (*type:* `String.t`, *default:* `nil`) - The full resource name of the resource. See: https://cloud.google.com/apis/design/resource_names#full_resource_name
  *   `resourcePath` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2ResourcePath.t`, *default:* `nil`) - Provides the path to the resource within the resource hierarchy.
  *   `resourcePathString` (*type:* `String.t`, *default:* `nil`) - A string representation of the resource path. For Google Cloud, it has the format of `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` where there can be any number of folders. For AWS, it has the format of `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` where there can be any number of organizational units. For Azure, it has the format of `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` where there can be any number of management groups.
  *   `service` (*type:* `String.t`, *default:* `nil`) - The service or resource provider associated with the resource.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The full resource type of the resource.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :awsMetadata =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2AwsMetadata.t() | nil,
          :azureMetadata =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2AzureMetadata.t() | nil,
          :cloudProvider => String.t() | nil,
          :displayName => String.t() | nil,
          :gcpMetadata => GoogleApi.SecurityCenter.V1.Model.GcpMetadata.t() | nil,
          :location => String.t() | nil,
          :name => String.t() | nil,
          :resourcePath =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2ResourcePath.t() | nil,
          :resourcePathString => String.t() | nil,
          :service => String.t() | nil,
          :type => String.t() | nil
        }

  field(:awsMetadata, as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2AwsMetadata)

  field(:azureMetadata,
    as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2AzureMetadata
  )

  field(:cloudProvider)
  field(:displayName)
  field(:gcpMetadata, as: GoogleApi.SecurityCenter.V1.Model.GcpMetadata)
  field(:location)
  field(:name)

  field(:resourcePath,
    as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2ResourcePath
  )

  field(:resourcePathString)
  field(:service)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2Resource do
  def decode(value, options) do
    GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2Resource.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2Resource do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
